var ctx = getRootPath();

function getRootPath(){
    var scriptObj = $("script[src$='/res/js/a.js']");
    if(scriptObj==undefined)
    {
        return "";
    }
    var srcBase = scriptObj.eq(0).attr("src").replace("/res/js/a.js","");;
    return srcBase
}